<?php /* Smarty version 2.6.26, created on 2018-07-25 14:04:03
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/member%5Ctemplates/index/register.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'import', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/index/register.html', 1, false),array('function', 'uqcms', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/index/register.html', 41, false),array('function', 'math', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/index/register.html', 47, false),)), $this); ?>
<?php echo $this->_plugins['function']['import'][0][0]->import(array('file' => "index/reg_header.html",'title' => "会员注册"), $this);?>
 
<div class="main_bar" style="margin:50px 0;"> 
	<div class="main"> 
		<div class="reg_left">
<form action="#" method="post"> 
			<div class="reg_bname"><span>用户注册</span></div>
			<div class="reg_bcon">
				<div id="error_msg" style="display:none;"></div>
				<div class="rbox_input">
					<span>手机号码</span>
					<input type="text" name="username" class="input1" placeholder="手机不能为空" value=""/> 
				</div>
				<div class="rbox_input">
					<span>登录密码</span>
					<input type="password" name="password" class="input1" placeholder="密码位数不能低于6位" /> 
				</div>
				<div class="rbox_input">
					<span>确认密码</span>
					<input type="password" name="repasswd" class="input1" placeholder="需要与上一步的密码一致" /> 
				</div>
				<div class="rbox_input">
					<span>验证码</span>
					<input type="text" name="vcode" id="vcode" class="input2" size="10" maxlength="6"/> 
					<a href="javascript:;"><img id="vcode" src="index.php?m=ajax&a=vcode"/></a> 
				</div>
				<div class="rbox_input tbsms">
					<span>短信验证码</span>
					<input type="text" name="smscode" class="input2" id="smscode" placeholder="手机验证码" maxlength="6"/>
					<input id="zphone" type="button" value="获取手机验证码"> 
				</div>
				<div class="rbox_sub"><input type="submit" name="submit" class="submit_reg" value="注 册"/></div> 
				
			</div>
</form>
			<div class="reg_other">
				<a href="?a=login">已有账号，立即登陆</a> 
				<a href="?a=forget">忘记密码</a> 
			</div>
		</div>
		<div class="reg_right">
			<?php echo $this->_plugins['function']['uqcms'][0][0]->load_module(array('m' => 'api','v' => 'conn','c' => 'login_list'), $this);?>
 
			<?php if ($this->_tpl_vars['conn']): ?>
				<div class="sub_frm2">
					<h3>快捷方式登录</h3>
					<div class="sub_con2">
						<?php $_from = $this->_tpl_vars['conn']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?> 
							<a href="member.php?a=connect&alias=<?php echo $this->_tpl_vars['i']['alias']; ?>
&state=<?php echo smarty_function_math(array('equation' => "rand(0,10000)"), $this);?>
" class="connect">
								<img src="<?php echo $this->_tpl_vars['__PUBLIC__']; ?>
images/connect/32<?php echo $this->_tpl_vars['i']['alias']; ?>
.png">
								<span><?php echo $this->_tpl_vars['i']['name']; ?>
</span>
							</a>
						<?php endforeach; endif; unset($_from); ?> 
					</div>
				</div>  
			<?php endif; ?>
		</div>
		
	</div> 
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript">
$(function(){ 
	$("form").submit(function(){ 
		var smscode = $('input[name=smscode]').val(); 
		if(smscode == ''){
			$("#error_msg").show().html('手机验证码不能为空'); return false;
		}
		var username = $('input[name=username]').val();
		if(username == ''){
			$("#error_msg").show().html('电话号码不能为空'); return false;
		}
		var password = $('input[name=password]').val(); 
		var repasswd = $('input[name=repasswd]').val(); 
		if(password == ''){ $.alert('密码不能为空');  return false;} 
		if(repasswd == ''){ $.alert('重复密码不能为空'); return false;}
		if(password != repasswd){ $.alert('两次密码输入不一致'); return false; }
		
		$.ajax({
			type:'POST',
			url:'member.php?a=do_register',
			data:{username:username, password:password, repasswd:repasswd, smscode:smscode}, 
			success:function(result){
				var data = jQuery.parseJSON(result); 
				if(data.error == '0'){
					window.location.href="member.php"; 
				}else{
					$("#error_msg").show().html(data.msg); 
					freshVcode();
					return false;
				}
			},
			error:function(){
				$.alert('系统繁忙');
			}
		}); 
		return false;
	});
	// 检测账号是否存在
	function checkMobileIsExist(){
		var mobile = jQuery("#username").val();
		var flag = true;
		jQuery.ajax({ 
			url:"?a=check_mobile&t="+(new Date()).getTime(),
			data:{mobile:mobile},
			dataType:"json",
			type:"GET",
			async:false,
			success:function(data) {
				var status = data.status;
				if(status == "0"){
					flag = false;
				}
			}
		});
		return flag;
	}
	// 获得验证码 
	$("#zphone").click(function(){
		var mobile = $('input[name=username]').val();  
		var vcode = $('input[name=vcode]').val(); 
		send_sms(mobile, vcode, '#zphone', '2');
	});  
}); 

</script>